from flask import Flask, jsonify
from flask_cors import CORS
from flask_restful import Api
from app.sources import init



app = Flask(__name__)
api = Api(app)


CORS(app)  # 允许跨域请求
init(api)

# 模拟数据库和表数据
# databases = [
#     {"id": 1, "name": "Database1"},
#     {"id": 2, "name": "Database2"}
# ]

# tables = {
#     1: ["Table1", "Table2"],
#     2: ["Table3", "Table4"]
# }

# @app.route('/show_databases', methods=['GET'])
# def get_databases():
#     return jsonify(databases)

# @app.route('/show_tables/', methods=['GET'])
# def get_tables(db_id):
#     db_tables = tables.get(db_id, [])
#     return jsonify(db_tables)


if __name__ == '__main__':
    app.run(debug=True, port=5000)
